package com.xlp.controller;

import com.xlp.TestJarService;
import com.xlp.service.TestService;
import com.xlp.service.TestServiceImpl2;
import com.xlp.service.TestServiceImpl3;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.xlp.TestJarService1;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/books")
public class BookController {
    @Autowired
    private TestService<String> testService1;
    @Autowired
    private TestService<Object> testServiceObject;

     @Autowired
     private TestService<Integer> testService;

     @Autowired(required = false)
     private TestJarService1 testJarService1;

     @Autowired
     private TestJarService testJarService;

    @RequestMapping("/id")
    public String getById(HttpServletRequest request){
        System.out.println(testService1);
        System.out.println(testServiceObject);
        System.out.println(((TestServiceImpl2) testServiceObject).getTestService());
        System.out.println(testService);

        testJarService.test();
        testJarService1.test();

        System.out.println(request);
        System.out.println("启动springboot，并访问");
        System.out.println(request.getParameter("id"));

        return "springboot is running...";
    }
}
